package com.example.ex5_springboot.mappers;

import com.example.ex5_springboot.pojo.UserRegister;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserRegisterMapper {
    @Select("select user_id,college,name,unregistered,Max(unregistered_time) as unregistered_time from user_register  group by user_id ")
    List<UserRegister> getAllUnRegisterUser();

    @Select("select user_id,college,name,unregistered,Max(unregistered_time) as unregistered_time from user_register where user_id=#{name}")
    List<UserRegister> getUnRegisterUserByName(int name);

    @Select("select count(*) from user_register where user_id=#{user_id}")
    int getCountOfUnregistered(int user_id);
}
